using System;
using System.Globalization;
using System.Linq;
using System.Windows;
using System.Windows.Data;
using System.Windows.Media;
using Common;
using Common.Enum;

namespace Converters
{
	public class StrokeDashArrayMultiConverter : IMultiValueConverter
	{
		public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
		{
			object obj = null;
			if (values.Count() == 2 && values[0] != null && values[0] != DependencyProperty.UnsetValue && values[0] is EColorMode && values[1] != null && values[1] != DependencyProperty.UnsetValue && values[1] is int)
			{
				switch ((EColorMode)values[0])
				{
				case EColorMode.Type:
					switch ((int)values[1])
					{
					case 1:
						obj = Utility.GetResource("DoubleCollectionChannel1");
						break;
					case 2:
						obj = Utility.GetResource("DoubleCollectionChannel2");
						break;
					case 3:
						obj = Utility.GetResource("DoubleCollectionChannel3");
						break;
					case 4:
						obj = Utility.GetResource("DoubleCollectionChannel4");
						break;
					case 5:
						obj = Utility.GetResource("DoubleCollectionChannel5");
						break;
					case 6:
						obj = Utility.GetResource("DoubleCollectionChannel6");
						break;
					}
					break;
				}
			}
			if (obj != null)
			{
				return obj as DoubleCollection;
			}
			return new DoubleCollection();
		}

		public object[] ConvertBack(object value, Type[] targetType, object parameter, CultureInfo culture)
		{
			return null;
		}
	}
}
